package com.example.a2032.db.dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;


import com.example.a2032.net.jstylenet.ContactData;

import java.util.List;


@Dao
public interface ContactDataDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(ContactData contact);

    @Query("select * from contactdata")
    LiveData<List<ContactData>> loadAllContact();

    @Query("select * from contactdata where id =:id")
    ContactData findContact(String id);

    @Update
    void updateContact(ContactData contactData);

    @Query("Delete from contactdata where id=:id")
    void deleteContact(String id);
}
